package com.fadis.protocol;

public class LongNumber extends BaseRespProtocol {
    private long number;

    public LongNumber(long number) {
        this.number = number;
    }

    public long getNumber() {
        return number;
    }

    @Override
    public String encode() {
        String ss = ":{s}\r\n";
        ss = ss.replace("{s}", number + "");
        return ss;
    }

    public static String encodeLong(long s){
        return CmdEncoder.getDefault().encode(new LongNumber(s));
    }


    public static String encodeInt(int s){
        return CmdEncoder.getDefault().encode(new LongNumber(s));
    }
}
